class GoodsEntity {
  String goods_id,
      goods_name,
      goods_img,
      price,
      goods_brand,
      is_focus,
      origin_price,
      goods_price;
  bool selectedMyState = false; //非json字段，用于我本地判断一些状态，如购物车选中状态等

  //----- 购物车中 --- start
  String rec_id, brand_id, goods_number;
  //----- 购物车中 --- stop

  //----- 即时排行中 --- start
  String market_price, shop_price;
  //----- 即时排行中 --- stop

  //----- 主题中 --- start
  String brand_name;
  //----- 主题中 --- stop

  GoodsEntity()
      : goods_name = '',
        goods_img = '';

  GoodsEntity.fromJson(dynamic json) {
    if (json != null && json is Map) {
      goods_id = json['goods_id'];
      goods_name = json['goods_name'];
      goods_img = json['goods_img'];
      goods_brand = json['goods_brand'];
      is_focus = json['is_focus'];
      origin_price = json['origin_price'];
      goods_price = json['goods_price'];
      price = json['price'];
      rec_id = json['rec_id'];
      brand_id = json['brand_id'];
      goods_number = json['goods_number'];
      brand_name = json['brand_name'];
      market_price = json['market_price'];
      shop_price = json['shop_price'];
    }
  }

  @override
  String toString() {
    return goods_name == null ? super.toString() : goods_name;
  }
}
